home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / lispref.info-3 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  48.0 KB  |  1,294 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo-1.63
  2. from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995
  12.  
  13.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  14. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  15. Copyright (C) 1995 Amdahl Corporation.  Copyright (C) 1995 Ben Wing.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that the
  23. entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31.    Permission is granted to copy and distribute modified versions of
  32. this manual under the conditions for verbatim copying, provided also
  33. that the section entitled "GNU General Public License" is included
  34. exactly as in the original, and provided that the entire resulting
  35. derived work is distributed under the terms of a permission notice
  36. identical to this one.
  37.  
  38.    Permission is granted to copy and distribute translations of this
  39. manual into another language, under the above conditions for modified
  40. versions, except that the section entitled "GNU General Public License"
  41. may be included in a translation approved by the Free Software
  42. Foundation instead of in the original English.
  43.  
  44. 
  45. File: lispref.info,  Node: Character Type,  Next: Symbol Type,  Prev: Floating Point Type,  Up: Programming Types
  46.  
  47. Character Type
  48. --------------
  49.  
  50.    A "character" in Emacs Lisp is nothing more than an integer.  In
  51. other words, characters are represented by their character codes.  For
  52. example, the character `A' is represented as the integer 65.
  53.  
  54.    Individual characters are not often used in programs.  It is far more
  55. common to work with *strings*, which are sequences composed of
  56. characters.  *Note String Type::.
  57.  
  58.    Characters in strings, buffers, and files are currently limited to
  59. the range of 0 to 255--eight bits.  If you store a larger integer into a
  60. string, buffer or file, it is truncated to that range.  Characters that
  61. represent keyboard input have a much wider range.
  62.  
  63.    Since characters are really integers, the printed representation of a
  64. character is a decimal number.  This is also a possible read syntax for
  65. a character, but writing characters that way in Lisp programs is a very
  66. bad idea.  You should *always* use the special read syntax formats that
  67. Emacs Lisp provides for characters.  These syntax formats start with a
  68. question mark.
  69.  
  70.    The usual read syntax for alphanumeric characters is a question mark
  71. followed by the character; thus, `?A' for the character `A', `?B' for
  72. the character `B', and `?a' for the character `a'.
  73.  
  74.    For example:
  75.  
  76.      ?Q => 81     ?q => 113
  77.  
  78.    You can use the same syntax for punctuation characters, but it is
  79. often a good idea to add a `\' so that the Emacs commands for editing
  80. Lisp code don't get confused.  For example, `?\ ' is the way to write
  81. the space character.  If the character is `\', you *must* use a second
  82. `\' to quote it: `?\\'.
  83.  
  84.    You can express the characters Control-g, backspace, tab, newline,
  85. vertical tab, formfeed, return, and escape as `?\a', `?\b', `?\t',
  86. `?\n', `?\v', `?\f', `?\r', `?\e', respectively.  Those values are 7,
  87. 8, 9, 10, 11, 12, 13, and 27 in decimal.  Thus,
  88.  
  89.      ?\a => 7                 ; `C-g'
  90.      ?\b => 8                 ; backspace, BS, `C-h'
  91.      ?\t => 9                 ; tab, TAB, `C-i'
  92.      ?\n => 10                ; newline, LFD, `C-j'
  93.      ?\v => 11                ; vertical tab, `C-k'
  94.      ?\f => 12                ; formfeed character, `C-l'
  95.      ?\r => 13                ; carriage return, RET, `C-m'
  96.      ?\e => 27                ; escape character, ESC, `C-['
  97.      ?\\ => 92                ; backslash character, `\'
  98.  
  99.    These sequences which start with backslash are also known as "escape
  100. sequences", because backslash plays the role of an escape character;
  101. this usage has nothing to do with the character ESC.
  102.  
  103.    Control characters may be represented using yet another read syntax.
  104. This consists of a question mark followed by a backslash, caret, and the
  105. corresponding non-control character, in either upper or lower case.  For
  106. example, both `?\^I' and `?\^i' are valid read syntax for the character
  107. `C-i', the character whose value is 9.
  108.  
  109.    Instead of the `^', you can use `C-'; thus, `?\C-i' is equivalent to
  110. `?\^I' and to `?\^i':
  111.  
  112.      ?\^I => 9     ?\C-I => 9
  113.  
  114.    For use in strings and buffers, you are limited to the control
  115. characters that exist in ASCII, but for keyboard input purposes, you
  116. can turn any character into a control character with `C-'.  The
  117. character codes for these non-ASCII control characters include the
  118.  
  119.    2**26 bit as well as the code for the corresponding non-control
  120. character.  Ordinary terminals have no way of generating non-ASCII
  121. control characters, but you can generate them straightforwardly using an
  122. X terminal.
  123.  
  124.    For historical reasons, Emacs treats the DEL character as the
  125. control equivalent of `?':
  126.  
  127.      ?\^? => 127     ?\C-? => 127
  128.  
  129. As a result, it is currently not possible to represent the character
  130. `Control-?', which is a meaningful input character under X.  It is not
  131. easy to change this as various Lisp files refer to DEL in this way.
  132.  
  133.    For representing control characters to be found in files or strings,
  134. we recommend the `^' syntax; for control characters in keyboard input,
  135. we prefer the `C-' syntax.  This does not affect the meaning of the
  136. program, but may guide the understanding of people who read it.
  137.  
  138.    A "meta character" is a character typed with the META modifier key.
  139. The integer that represents such a character has the
  140.  
  141.    2**27 bit set (which on most machines makes it a negative number).
  142. We use high bits for this and other modifiers to make possible a wide
  143. range of basic character codes.
  144.  
  145.    In a string, the
  146.  
  147.    2**7 bit indicates a meta character, so the meta characters that can
  148. fit in a string have codes in the range from 128 to 255, and are the
  149. meta versions of the ordinary ASCII characters.  (In Emacs versions 18
  150. and older, this convention was used for characters outside of strings
  151. as well.)
  152.  
  153.    The read syntax for meta characters uses `\M-'.  For example,
  154. `?\M-A' stands for `M-A'.  You can use `\M-' together with octal
  155. character codes (see below), with `\C-', or with any other syntax for a
  156. character.  Thus, you can write `M-A' as `?\M-A', or as `?\M-\101'.
  157. Likewise, you can write `C-M-b' as `?\M-\C-b', `?\C-\M-b', or
  158. `?\M-\002'.
  159.  
  160.    The case of an ordinary letter is indicated by its character code as
  161. part of ASCII, but ASCII has no way to represent whether a control
  162. character is upper case or lower case.  Emacs uses the
  163.  
  164.    2**25 bit to indicate that the shift key was used for typing a
  165. control character.  This distinction is possible only when you use X
  166. terminals or other special terminals; ordinary terminals do not
  167. indicate the distinction to the computer in any way.
  168.  
  169.    The X Window System defines three other modifier bits that can be set
  170. in a character: "hyper", "super" and "alt".  The syntaxes for these
  171. bits are `\H-', `\s-' and `\A-'.  Thus, `?\H-\M-\A-x' represents
  172. `Alt-Hyper-Meta-x'.
  173.  
  174.    Numerically, the bit values are 2**22 for alt, 2**23 for super and
  175. 2**24 for hyper.
  176.  
  177.    Finally, the most general read syntax consists of a question mark
  178. followed by a backslash and the character code in octal (up to three
  179. octal digits); thus, `?\101' for the character `A', `?\001' for the
  180. character `C-a', and `?\002' for the character `C-b'.  Although this
  181. syntax can represent any ASCII character, it is preferred only when the
  182. precise octal value is more important than the ASCII representation.
  183.  
  184.      ?\012 => 10         ?\n => 10         ?\C-j => 10
  185.      ?\101 => 65         ?A => 65
  186.  
  187.    A backslash is allowed, and harmless, preceding any character without
  188. a special escape meaning; thus, `?\+' is equivalent to `?+'.  There is
  189. no reason to add a backslash before most characters.  However, you
  190. should add a backslash before any of the characters `()\|;'`"#.,' to
  191. avoid confusing the Emacs commands for editing Lisp code.  Also add a
  192. backslash before whitespace characters such as space, tab, newline and
  193. formfeed.  However, it is cleaner to use one of the easily readable
  194. escape sequences, such as `\t', instead of an actual whitespace
  195. character such as a tab.
  196.  
  197. 
  198. File: lispref.info,  Node: Symbol Type,  Next: Sequence Type,  Prev: Character Type,  Up: Programming Types
  199.  
  200. Symbol Type
  201. -----------
  202.  
  203.    A "symbol" in GNU Emacs Lisp is an object with a name.  The symbol
  204. name serves as the printed representation of the symbol.  In ordinary
  205. use, the name is unique--no two symbols have the same name.
  206.  
  207.    A symbol can serve as a variable, as a function name, or to hold a
  208. property list.  Or it may serve only to be distinct from all other Lisp
  209. objects, so that its presence in a data structure may be recognized
  210. reliably.  In a given context, usually only one of these uses is
  211. intended.  But you can use one symbol in all of these ways,
  212. independently.
  213.  
  214.    A symbol name can contain any characters whatever.  Most symbol names
  215. are written with letters, digits, and the punctuation characters
  216. `-+=*/'.  Such names require no special punctuation; the characters of
  217. the name suffice as long as the name does not look like a number.  (If
  218. it does, write a `\' at the beginning of the name to force
  219. interpretation as a symbol.)  The characters `_~!@$%^&:<>{}' are less
  220. often used but also require no special punctuation.  Any other
  221. characters may be included in a symbol's name by escaping them with a
  222. backslash.  In contrast to its use in strings, however, a backslash in
  223. the name of a symbol simply quotes the single character that follows the
  224. backslash.  For example, in a string, `\t' represents a tab character;
  225. in the name of a symbol, however, `\t' merely quotes the letter `t'.
  226. To have a symbol with a tab character in its name, you must actually
  227. use a tab (preceded with a backslash).  But it's rare to do such a
  228. thing.
  229.  
  230.      Common Lisp note: In Common Lisp, lower case letters are always
  231.      "folded" to upper case, unless they are explicitly escaped.  In
  232.      Emacs Lisp, upper case and lower case letters are distinct.
  233.  
  234.    Here are several examples of symbol names.  Note that the `+' in the
  235. fifth example is escaped to prevent it from being read as a number.
  236. This is not necessary in the sixth example because the rest of the name
  237. makes it invalid as a number.
  238.  
  239.      foo                 ; A symbol named `foo'.
  240.      FOO                 ; A symbol named `FOO', different from `foo'.
  241.      char-to-string      ; A symbol named `char-to-string'.
  242.      1+                  ; A symbol named `1+'
  243.                          ;   (not `+1', which is an integer).
  244.      \+1                 ; A symbol named `+1'
  245.                          ;   (not a very readable name).
  246.      \(*\ 1\ 2\)         ; A symbol named `(* 1 2)' (a worse name).
  247.      +-*/_~!@$%^&=:<>{}  ; A symbol named `+-*/_~!@$%^&=:<>{}'.
  248.                          ;   These characters need not be escaped.
  249.  
  250. 
  251. File: lispref.info,  Node: Sequence Type,  Next: Cons Cell Type,  Prev: Symbol Type,  Up: Programming Types
  252.  
  253. Sequence Types
  254. --------------
  255.  
  256.    A "sequence" is a Lisp object that represents an ordered set of
  257. elements.  There are two kinds of sequence in Emacs Lisp, lists and
  258. arrays.  Thus, an object of type list or of type array is also
  259. considered a sequence.
  260.  
  261.    Arrays are further subdivided into strings and vectors.  Vectors can
  262. hold elements of any type, but string elements must be characters in the
  263. range from 0 to 255.  However, the characters in a string can have text
  264. properties like characters in a buffer (*note Text Properties::.);
  265. vectors do not support text properties even when their elements happen
  266. to be characters.
  267.  
  268.    Lists, strings and vectors are different, but they have important
  269. similarities.  For example, all have a length L, and all have elements
  270. which can be indexed from zero to L minus one.  Also, several
  271. functions, called sequence functions, accept any kind of sequence.  For
  272. example, the function `elt' can be used to extract an element of a
  273. sequence, given its index.  *Note Sequences Arrays Vectors::.
  274.  
  275.    It is impossible to read the same sequence twice, since sequences are
  276. always created anew upon reading.  If you read the read syntax for a
  277. sequence twice, you get two sequences with equal contents.  There is one
  278. exception: the empty list `()' always stands for the same object, `nil'.
  279.  
  280. 
  281. File: lispref.info,  Node: Cons Cell Type,  Next: Array Type,  Prev: Sequence Type,  Up: Programming Types
  282.  
  283. Cons Cell and List Types
  284. ------------------------
  285.  
  286.    A "cons cell" is an object comprising two pointers named the CAR and
  287. the CDR.  Each of them can point to any Lisp object.
  288.  
  289.    A "list" is a series of cons cells, linked together so that the CDR
  290. of each cons cell points either to another cons cell or to the empty
  291. list.  *Note Lists::, for functions that work on lists.  Because most
  292. cons cells are used as part of lists, the phrase "list structure" has
  293. come to refer to any structure made out of cons cells.
  294.  
  295.    The names CAR and CDR have only historical meaning now.  The
  296. original Lisp implementation ran on an IBM 704 computer which divided
  297. words into two parts, called the "address" part and the "decrement";
  298. CAR was an instruction to extract the contents of the address part of a
  299. register, and CDR an instruction to extract the contents of the
  300. decrement.  By contrast, "cons cells" are named for the function `cons'
  301. that creates them, which in turn is named for its purpose, the
  302. construction of cells.
  303.  
  304.    Because cons cells are so central to Lisp, we also have a word for
  305. "an object which is not a cons cell".  These objects are called "atoms".
  306.  
  307.    The read syntax and printed representation for lists are identical,
  308. and consist of a left parenthesis, an arbitrary number of elements, and
  309. a right parenthesis.
  310.  
  311.    Upon reading, each object inside the parentheses becomes an element
  312. of the list.  That is, a cons cell is made for each element.  The CAR
  313. of the cons cell points to the element, and its CDR points to the next
  314. cons cell of the list, which holds the next element in the list.  The
  315. CDR of the last cons cell is set to point to `nil'.
  316.  
  317.    A list can be illustrated by a diagram in which the cons cells are
  318. shown as pairs of boxes.  (The Lisp reader cannot read such an
  319. illustration; unlike the textual notation, which can be understood by
  320. both humans and computers, the box illustrations can be understood only
  321. by humans.)  The following represents the three-element list `(rose
  322. violet buttercup)':
  323.  
  324.          ___ ___      ___ ___      ___ ___
  325.         |___|___|--> |___|___|--> |___|___|--> nil
  326.           |            |            |
  327.           |            |            |
  328.            --> rose     --> violet   --> buttercup
  329.  
  330.    In this diagram, each box represents a slot that can refer to any
  331. Lisp object.  Each pair of boxes represents a cons cell.  Each arrow is
  332. a reference to a Lisp object, either an atom or another cons cell.
  333.  
  334.    In this example, the first box, the CAR of the first cons cell,
  335. refers to or "contains" `rose' (a symbol).  The second box, the CDR of
  336. the first cons cell, refers to the next pair of boxes, the second cons
  337. cell.  The CAR of the second cons cell refers to `violet' and the CDR
  338. refers to the third cons cell.  The CDR of the third (and last) cons
  339. cell refers to `nil'.
  340.  
  341.    Here is another diagram of the same list, `(rose violet buttercup)',
  342. sketched in a different manner:
  343.  
  344.      ---------------       ----------------       -------------------
  345.      | car   | cdr   |     | car    | cdr   |     | car       | cdr   |
  346.      | rose  |   o-------->| violet |   o-------->| buttercup |  nil  |
  347.      |       |       |     |        |       |     |           |       |
  348.       ---------------       ----------------       -------------------
  349.  
  350.    A list with no elements in it is the "empty list"; it is identical
  351. to the symbol `nil'.  In other words, `nil' is both a symbol and a list.
  352.  
  353.    Here are examples of lists written in Lisp syntax:
  354.  
  355.      (A 2 "A")            ; A list of three elements.
  356.      ()                   ; A list of no elements (the empty list).
  357.      nil                  ; A list of no elements (the empty list).
  358.      ("A ()")             ; A list of one element: the string `"A ()"'.
  359.      (A ())               ; A list of two elements: `A' and the empty list.
  360.      (A nil)              ; Equivalent to the previous.
  361.      ((A B C))            ; A list of one element
  362.                           ;   (which is a list of three elements).
  363.  
  364.    Here is the list `(A ())', or equivalently `(A nil)', depicted with
  365. boxes and arrows:
  366.  
  367.          ___ ___      ___ ___
  368.         |___|___|--> |___|___|--> nil
  369.           |            |
  370.           |            |
  371.            --> A        --> nil
  372.  
  373. * Menu:
  374.  
  375. * Dotted Pair Notation::        An alternative syntax for lists.
  376. * Association List Type::       A specially constructed list.
  377.  
  378. 
  379. File: lispref.info,  Node: Dotted Pair Notation,  Next: Association List Type,  Up: Cons Cell Type
  380.  
  381. Dotted Pair Notation
  382. ....................
  383.  
  384.    "Dotted pair notation" is an alternative syntax for cons cells that
  385. represents the CAR and CDR explicitly.  In this syntax, `(A . B)'
  386. stands for a cons cell whose CAR is the object A, and whose CDR is the
  387. object B.  Dotted pair notation is therefore more general than list
  388. syntax.  In the dotted pair notation, the list `(1 2 3)' is written as
  389. `(1 .  (2 . (3 . nil)))'.  For `nil'-terminated lists, the two
  390. notations produce the same result, but list notation is usually clearer
  391. and more convenient when it is applicable.  When printing a list, the
  392. dotted pair notation is only used if the CDR of a cell is not a list.
  393.  
  394.    Here's how box notation can illustrate dotted pairs.  This example
  395. shows the pair `(rose . violet)':
  396.  
  397.          ___ ___
  398.         |___|___|--> violet
  399.           |
  400.           |
  401.            --> rose
  402.  
  403.    Dotted pair notation can be combined with list notation to represent
  404. a chain of cons cells with a non-`nil' final CDR.  For example, `(rose
  405. violet . buttercup)' is equivalent to `(rose . (violet . buttercup))'.
  406. The object looks like this:
  407.  
  408.          ___ ___      ___ ___
  409.         |___|___|--> |___|___|--> buttercup
  410.           |            |
  411.           |            |
  412.            --> rose     --> violet
  413.  
  414.    These diagrams make it evident why `(rose . violet . buttercup)' is
  415. invalid syntax; it would require a cons cell that has three parts
  416. rather than two.
  417.  
  418.    The list `(rose violet)' is equivalent to `(rose . (violet))' and
  419. looks like this:
  420.  
  421.          ___ ___      ___ ___
  422.         |___|___|--> |___|___|--> nil
  423.           |            |
  424.           |            |
  425.            --> rose     --> violet
  426.  
  427.    Similarly, the three-element list `(rose violet buttercup)' is
  428. equivalent to `(rose . (violet . (buttercup)))'.
  429.  
  430.    It looks like this:
  431.  
  432.          ___ ___      ___ ___      ___ ___
  433.         |___|___|--> |___|___|--> |___|___|--> nil
  434.           |            |            |
  435.           |            |            |
  436.            --> rose     --> violet   --> buttercup
  437.  
  438. 
  439. File: lispref.info,  Node: Association List Type,  Prev: Dotted Pair Notation,  Up: Cons Cell Type
  440.  
  441. Association List Type
  442. .....................
  443.  
  444.    An "association list" or "alist" is a specially-constructed list
  445. whose elements are cons cells.  In each element, the CAR is considered
  446. a "key", and the CDR is considered an "associated value".  (In some
  447. cases, the associated value is stored in the CAR of the CDR.)
  448. Association lists are often used as stacks, since it is easy to add or
  449. remove associations at the front of the list.
  450.  
  451.    For example,
  452.  
  453.      (setq alist-of-colors
  454.            '((rose . red) (lily . white)  (buttercup . yellow)))
  455.  
  456. sets the variable `alist-of-colors' to an alist of three elements.  In
  457. the first element, `rose' is the key and `red' is the value.
  458.  
  459.    *Note Association Lists::, for a further explanation of alists and
  460. for functions that work on alists.
  461.  
  462. 
  463. File: lispref.info,  Node: Array Type,  Next: String Type,  Prev: Cons Cell Type,  Up: Programming Types
  464.  
  465. Array Type
  466. ----------
  467.  
  468.    An "array" is composed of an arbitrary number of slots for referring
  469. to other Lisp objects, arranged in a contiguous block of memory.
  470. Accessing any element of an array takes the same amount of time.  In
  471. contrast, accessing an element of a list requires time proportional to
  472. the position of the element in the list.  (Elements at the end of a
  473. list take longer to access than elements at the beginning of a list.)
  474.  
  475.    XEmacs defines two types of array, strings and vectors.  A string is
  476. an array of characters and a vector is an array of arbitrary objects.
  477. Both are one-dimensional.  (Most other programming languages support
  478. multidimensional arrays, but they are not essential; you can get the
  479. same effect with an array of arrays.)  Each type of array has its own
  480. read syntax; see *Note String Type::, and *Note Vector Type::.
  481.  
  482.    An array may have any length up to the largest integer; but once
  483. created, it has a fixed size.  The first element of an array has index
  484. zero, the second element has index 1, and so on.  This is called
  485. "zero-origin" indexing.  For example, an array of four elements has
  486. indices 0, 1, 2, and 3.
  487.  
  488.    The array type is contained in the sequence type and contains both
  489. the string type and the vector type.
  490.  
  491. 
  492. File: lispref.info,  Node: String Type,  Next: Vector Type,  Prev: Array Type,  Up: Programming Types
  493.  
  494. String Type
  495. -----------
  496.  
  497.    A "string" is an array of characters.  Strings are used for many
  498. purposes in XEmacs, as can be expected in a text editor; for example, as
  499. the names of Lisp symbols, as messages for the user, and to represent
  500. text extracted from buffers.  Strings in Lisp are constants: evaluation
  501. of a string returns the same string.
  502.  
  503.    The read syntax for strings is a double-quote, an arbitrary number of
  504. characters, and another double-quote, `"like this"'.  The Lisp reader
  505. accepts the same formats for reading the characters of a string as it
  506. does for reading single characters (without the question mark that
  507. begins a character literal).  You can enter a nonprinting character such
  508. as tab, `C-a' or `M-C-A' using the convenient escape sequences, like
  509. this: `"\t, \C-a, \M-\C-a"'.  You can include a double-quote in a
  510. string by preceding it with a backslash; thus, `"\""' is a string
  511. containing just a single double-quote character.  (*Note Character
  512. Type::, for a description of the read syntax for characters.)
  513.  
  514.    If you use the `\M-' syntax to indicate a meta character in a string
  515. constant, this sets the
  516.  
  517.    2**7 bit of the character in the string.  This is not the same
  518. representation that the meta modifier has in a character on its own
  519. (not inside a string).  *Note Character Type::.
  520.  
  521.    Strings cannot hold characters that have the hyper, super, or alt
  522. modifiers; they can hold ASCII control characters, but no others.  They
  523. do not distinguish case in ASCII control characters.
  524.  
  525.    The printed representation of a string consists of a double-quote,
  526. the characters it contains, and another double-quote.  However, you must
  527. escape any backslash or double-quote characters in the string with a
  528. backslash, like this: `"this \" is an embedded quote"'.
  529.  
  530.    The newline character is not special in the read syntax for strings;
  531. if you write a new line between the double-quotes, it becomes a
  532. character in the string.  But an escaped newline--one that is preceded
  533. by `\'--does not become part of the string; i.e., the Lisp reader
  534. ignores an escaped newline while reading a string.
  535.  
  536.      "It is useful to include newlines
  537.      in documentation strings,
  538.      but the newline is \
  539.      ignored if escaped."
  540.           => "It is useful to include newlines
  541.      in documentation strings,
  542.      but the newline is ignored if escaped."
  543.  
  544.    A string can hold properties of the text it contains, in addition to
  545. the characters themselves.  This enables programs that copy text between
  546. strings and buffers to preserve the properties with no special effort.
  547. *Note Text Properties::.  Strings with text properties have a special
  548. read and print syntax:
  549.  
  550.      #("CHARACTERS" PROPERTY-DATA...)
  551.  
  552. where PROPERTY-DATA consists of zero or more elements, in groups of
  553. three as follows:
  554.  
  555.      BEG END PLIST
  556.  
  557. The elements BEG and END are integers, and together specify a range of
  558. indices in the string; PLIST is the property list for that range.
  559.  
  560.    *Note Strings and Characters::, for functions that work on strings.
  561.  
  562. 
  563. File: lispref.info,  Node: Vector Type,  Next: Function Type,  Prev: String Type,  Up: Programming Types
  564.  
  565. Vector Type
  566. -----------
  567.  
  568.    A "vector" is a one-dimensional array of elements of any type.  It
  569. takes a constant amount of time to access any element of a vector.  (In
  570. a list, the access time of an element is proportional to the distance of
  571. the element from the beginning of the list.)
  572.  
  573.    The printed representation of a vector consists of a left square
  574. bracket, the elements, and a right square bracket.  This is also the
  575. read syntax.  Like numbers and strings, vectors are considered constants
  576. for evaluation.
  577.  
  578.      [1 "two" (three)]      ; A vector of three elements.
  579.           => [1 "two" (three)]
  580.  
  581.    *Note Vectors::, for functions that work with vectors.
  582.  
  583. 
  584. File: lispref.info,  Node: Function Type,  Next: Macro Type,  Prev: Vector Type,  Up: Programming Types
  585.  
  586. Function Type
  587. -------------
  588.  
  589.    Just as functions in other programming languages are executable,
  590. "Lisp function" objects are pieces of executable code.  However,
  591. functions in Lisp are primarily Lisp objects, and only secondarily the
  592. text which represents them.  These Lisp objects are lambda expressions:
  593. lists whose first element is the symbol `lambda' (*note Lambda
  594. Expressions::.).
  595.  
  596.    In most programming languages, it is impossible to have a function
  597. without a name.  In Lisp, a function has no intrinsic name.  A lambda
  598. expression is also called an "anonymous function" (*note Anonymous
  599. Functions::.).  A named function in Lisp is actually a symbol with a
  600. valid function in its function cell (*note Defining Functions::.).
  601.  
  602.    Most of the time, functions are called when their names are written
  603. in Lisp expressions in Lisp programs.  However, you can construct or
  604. obtain a function object at run time and then call it with the primitive
  605. functions `funcall' and `apply'.  *Note Calling Functions::.
  606.  
  607. 
  608. File: lispref.info,  Node: Macro Type,  Next: Primitive Function Type,  Prev: Function Type,  Up: Programming Types
  609.  
  610. Macro Type
  611. ----------
  612.  
  613.    A "Lisp macro" is a user-defined construct that extends the Lisp
  614. language.  It is represented as an object much like a function, but with
  615. different parameter-passing semantics.  A Lisp macro has the form of a
  616. list whose first element is the symbol `macro' and whose CDR is a Lisp
  617. function object, including the `lambda' symbol.
  618.  
  619.    Lisp macro objects are usually defined with the built-in `defmacro'
  620. function, but any list that begins with `macro' is a macro as far as
  621. XEmacs is concerned.  *Note Macros::, for an explanation of how to
  622. write a macro.
  623.  
  624. 
  625. File: lispref.info,  Node: Primitive Function Type,  Next: Byte-Code Type,  Prev: Macro Type,  Up: Programming Types
  626.  
  627. Primitive Function Type
  628. -----------------------
  629.  
  630.    A "primitive function" is a function callable from Lisp but written
  631. in the C programming language.  Primitive functions are also called
  632. "subrs" or "built-in functions".  (The word "subr" is derived from
  633. "subroutine".)  Most primitive functions evaluate all their arguments
  634. when they are called.  A primitive function that does not evaluate all
  635. its arguments is called a "special form" (*note Special Forms::.).
  636.  
  637.    It does not matter to the caller of a function whether the function
  638. is primitive.  However, this does matter if you try to substitute a
  639. function written in Lisp for a primitive of the same name.  The reason
  640. is that the primitive function may be called directly from C code.
  641. Calls to the redefined function from Lisp will use the new definition,
  642. but calls from C code may still use the built-in definition.
  643.  
  644.    The term "function" refers to all Emacs functions, whether written
  645. in Lisp or C.  *Note Function Type::, for information about the
  646. functions written in Lisp.
  647.  
  648.    Primitive functions have no read syntax and print in hash notation
  649. with the name of the subroutine.
  650.  
  651.      (symbol-function 'car)          ; Access the function cell
  652.                                      ;   of the symbol.
  653.           => #<subr car>
  654.      (subrp (symbol-function 'car))  ; Is this a primitive function?
  655.           => t                       ; Yes.
  656.  
  657. 
  658. File: lispref.info,  Node: Byte-Code Type,  Next: Autoload Type,  Prev: Primitive Function Type,  Up: Programming Types
  659.  
  660. Byte-Code Function Type
  661. -----------------------
  662.  
  663.    The byte compiler produces "byte-code function objects".
  664. Internally, a byte-code function object is much like a vector; however,
  665. the evaluator handles this data type specially when it appears as a
  666. function to be called.  *Note Byte Compilation::, for information about
  667. the byte compiler.
  668.  
  669.    The printed representation and read syntax for a byte-code function
  670. object is like that for a vector, with an additional `#' before the
  671. opening `['.
  672.  
  673. 
  674. File: lispref.info,  Node: Autoload Type,  Prev: Byte-Code Type,  Up: Programming Types
  675.  
  676. Autoload Type
  677. -------------
  678.  
  679.    An "autoload object" is a list whose first element is the symbol
  680. `autoload'.  It is stored as the function definition of a symbol as a
  681. placeholder for the real definition; it says that the real definition
  682. is found in a file of Lisp code that should be loaded when necessary.
  683. The autoload object contains the name of the file, plus some other
  684. information about the real definition.
  685.  
  686.    After the file has been loaded, the symbol should have a new function
  687. definition that is not an autoload object.  The new definition is then
  688. called as if it had been there to begin with.  From the user's point of
  689. view, the function call works as expected, using the function definition
  690. in the loaded file.
  691.  
  692.    An autoload object is usually created with the function `autoload',
  693. which stores the object in the function cell of a symbol.  *Note
  694. Autoload::, for more details.
  695.  
  696. 
  697. File: lispref.info,  Node: Editing Types,  Next: Window-System Types,  Prev: Programming Types,  Up: Lisp Data Types
  698.  
  699. Editing Types
  700. =============
  701.  
  702.    The types in the previous section are common to many Lisp dialects.
  703. Emacs Lisp provides several additional data types for purposes connected
  704. with editing.
  705.  
  706. * Menu:
  707.  
  708. * Buffer Type::         The basic object of editing.
  709. * Marker Type::         A position in a buffer.
  710. * Window Type::         Buffers are displayed in windows.
  711. * Frame Type::        Windows subdivide frames.
  712. * Window Configuration Type::   Recording the way a frame is subdivided.
  713. * Process Type::        A process running on the underlying OS.
  714. * Stream Type::         Receive or send characters.
  715. * Keymap Type::         What function a keystroke invokes.
  716. * Syntax Table Type::   What a character means.
  717. * Display Table Type::  How display tables are represented.
  718. * Extent Type::         How an extent is represented.
  719.  
  720. 
  721. File: lispref.info,  Node: Buffer Type,  Next: Marker Type,  Up: Editing Types
  722.  
  723. Buffer Type
  724. -----------
  725.  
  726.    A "buffer" is an object that holds text that can be edited (*note
  727. Buffers::.).  Most buffers hold the contents of a disk file (*note
  728. Files::.) so they can be edited, but some are used for other purposes.
  729. Most buffers are also meant to be seen by the user, and therefore
  730. displayed, at some time, in a window (*note Windows::.).  But a buffer
  731. need not be displayed in any window.
  732.  
  733.    The contents of a buffer are much like a string, but buffers are not
  734. used like strings in Emacs Lisp, and the available operations are
  735. different.  For example, insertion of text into a buffer is very
  736. efficient, whereas "inserting" text into a string requires
  737. concatenating substrings, and the result is an entirely new string
  738. object.
  739.  
  740.    Each buffer has a designated position called "point" (*note
  741. Positions::.).  At any time, one buffer is the "current buffer".  Most
  742. editing commands act on the contents of the current buffer in the
  743. neighborhood of point.  Many of the standard Emacs functions manipulate
  744. or test the characters in the current buffer; a whole chapter in this
  745. manual is devoted to describing these functions (*note Text::.).
  746.  
  747.    Several other data structures are associated with each buffer:
  748.  
  749.    * a local syntax table (*note Syntax Tables::.);
  750.  
  751.    * a local keymap (*note Keymaps::.); and,
  752.  
  753.    * a local variable binding list (*note Buffer-Local Variables::.).
  754.  
  755.    * a list of extents (*note Extents::.).
  756.  
  757. The local keymap and variable list contain entries that individually
  758. override global bindings or values.  These are used to customize the
  759. behavior of programs in different buffers, without actually changing the
  760. programs.
  761.  
  762.    A buffer may be "indirect", which means it shares the text of
  763. another buffer.  *Note Indirect Buffers::.
  764.  
  765.    Buffers have no read syntax.  They print in hash notation, showing
  766. the buffer name.
  767.  
  768.      (current-buffer)
  769.           => #<buffer objects.texi>
  770.  
  771. 
  772. File: lispref.info,  Node: Marker Type,  Next: Window Type,  Prev: Buffer Type,  Up: Editing Types
  773.  
  774. Marker Type
  775. -----------
  776.  
  777.    A "marker" denotes a position in a specific buffer.  Markers
  778. therefore have two components: one for the buffer, and one for the
  779. position.  Changes in the buffer's text automatically relocate the
  780. position value as necessary to ensure that the marker always points
  781. between the same two characters in the buffer.
  782.  
  783.    Markers have no read syntax.  They print in hash notation, giving the
  784. current character position and the name of the buffer.
  785.  
  786.      (point-marker)
  787.           => #<marker at 10779 in objects.texi>
  788.  
  789.    *Note Markers::, for information on how to test, create, copy, and
  790. move markers.
  791.  
  792. 
  793. File: lispref.info,  Node: Window Type,  Next: Frame Type,  Prev: Marker Type,  Up: Editing Types
  794.  
  795. Window Type
  796. -----------
  797.  
  798.    A "window" describes the portion of the terminal frame that XEmacs
  799. uses to display a buffer.  Every window has one associated buffer, whose
  800. contents appear in the window.  By contrast, a given buffer may appear
  801. in one window, no window, or several windows.
  802.  
  803.    Though many windows may exist simultaneously, at any time one window
  804. is designated the "selected window".  This is the window where the
  805. cursor is (usually) displayed when Emacs is ready for a command.  The
  806. selected window usually displays the current buffer, but this is not
  807. necessarily the case.
  808.  
  809.    Windows are grouped on the screen into frames; each window belongs to
  810. one and only one frame.  *Note Frame Type::.
  811.  
  812.    Windows have no read syntax.  They print in hash notation, giving the
  813. window number and the name of the buffer being displayed.  The window
  814. numbers exist to identify windows uniquely, since the buffer displayed
  815. in any given window can change frequently.
  816.  
  817.      (selected-window)
  818.           => #<window 1 on objects.texi>
  819.  
  820.    *Note Windows::, for a description of the functions that work on
  821. windows.
  822.  
  823. 
  824. File: lispref.info,  Node: Frame Type,  Next: Window Configuration Type,  Prev: Window Type,  Up: Editing Types
  825.  
  826. Frame Type
  827. ----------
  828.  
  829.    A FRAME is a rectangle on the screen that contains one or more Emacs
  830. windows.  A frame initially contains a single main window (plus perhaps
  831. a minibuffer window) which you can subdivide vertically or horizontally
  832. into smaller windows.
  833.  
  834.    Frames have no read syntax.  They print in hash notation, giving the
  835. frame's title, plus its address in core (useful to identify the frame
  836. uniquely).
  837.  
  838.      (selected-frame)
  839.           => #<frame xemacs@mole.gnu.ai.mit.edu 0xdac80>
  840.  
  841.    *Note Frames::, for a description of the functions that work on
  842. frames.
  843.  
  844. 
  845. File: lispref.info,  Node: Window Configuration Type,  Next: Process Type,  Prev: Frame Type,  Up: Editing Types
  846.  
  847. Window Configuration Type
  848. -------------------------
  849.  
  850.    A "window configuration" stores information about the positions,
  851. sizes, and contents of the windows in a frame, so you can recreate the
  852. same arrangement of windows later.
  853.  
  854.    Window configurations do not have a read syntax.  They print as
  855. `#<window-configuration>'.  *Note Window Configurations::, for a
  856. description of several functions related to window configurations.
  857.  
  858. 
  859. File: lispref.info,  Node: Process Type,  Next: Stream Type,  Prev: Window Configuration Type,  Up: Editing Types
  860.  
  861. Process Type
  862. ------------
  863.  
  864.    The word "process" usually means a running program.  Emacs itself
  865. runs in a process of this sort.  However, in Emacs Lisp, a process is a
  866. Lisp object that designates a subprocess created by the Emacs process.
  867. Programs such as shells, GDB, ftp, and compilers, running in
  868. subprocesses of Emacs, extend the capabilities of Emacs.
  869.  
  870.    An Emacs subprocess takes textual input from Emacs and returns
  871. textual output to Emacs for further manipulation.  Emacs can also send
  872. signals to the subprocess.
  873.  
  874.    Process objects have no read syntax.  They print in hash notation,
  875. giving the name of the process:
  876.  
  877.      (process-list)
  878.           => (#<process shell>)
  879.  
  880.    *Note Processes::, for information about functions that create,
  881. delete, return information about, send input or signals to, and receive
  882. output from processes.
  883.  
  884. 
  885. File: lispref.info,  Node: Stream Type,  Next: Keymap Type,  Prev: Process Type,  Up: Editing Types
  886.  
  887. Stream Type
  888. -----------
  889.  
  890.    A "stream" is an object that can be used as a source or sink for
  891. characters--either to supply characters for input or to accept them as
  892. output.  Many different types can be used this way: markers, buffers,
  893. strings, and functions.  Most often, input streams (character sources)
  894. obtain characters from the keyboard, a buffer, or a file, and output
  895. streams (character sinks) send characters to a buffer, such as a
  896. `*Help*' buffer, or to the echo area.
  897.  
  898.    The object `nil', in addition to its other meanings, may be used as
  899. a stream.  It stands for the value of the variable `standard-input' or
  900. `standard-output'.  Also, the object `t' as a stream specifies input
  901. using the minibuffer (*note Minibuffers::.) or output in the echo area
  902. (*note The Echo Area::.).
  903.  
  904.    Streams have no special printed representation or read syntax, and
  905. print as whatever primitive type they are.
  906.  
  907.    *Note Read and Print::, for a description of functions related to
  908. streams, including parsing and printing functions.
  909.  
  910. 
  911. File: lispref.info,  Node: Keymap Type,  Next: Syntax Table Type,  Prev: Stream Type,  Up: Editing Types
  912.  
  913. Keymap Type
  914. -----------
  915.  
  916.    A "keymap" maps keys typed by the user to commands.  This mapping
  917. controls how the user's command input is executed.  A keymap is actually
  918. a list whose CAR is the symbol `keymap'.
  919.  
  920.    *Note Keymaps::, for information about creating keymaps, handling
  921. prefix keys, local as well as global keymaps, and changing key bindings.
  922.  
  923. 
  924. File: lispref.info,  Node: Syntax Table Type,  Next: Display Table Type,  Prev: Keymap Type,  Up: Editing Types
  925.  
  926. Syntax Table Type
  927. -----------------
  928.  
  929.    A "syntax table" is a vector of 256 integers.  Each element of the
  930. vector defines how one character is interpreted when it appears in a
  931. buffer.  For example, in C mode (*note Major Modes::.), the `+'
  932. character is punctuation, but in Lisp mode it is a valid character in a
  933. symbol.  These modes specify different interpretations by changing the
  934. syntax table entry for `+', at index 43 in the syntax table.
  935.  
  936.    Syntax tables are used only for scanning text in buffers, not for
  937. reading Lisp expressions.  The table the Lisp interpreter uses to read
  938. expressions is built into the XEmacs source code and cannot be changed;
  939. thus, to change the list delimiters to be `{' and `}' instead of `('
  940. and `)' would be impossible.
  941.  
  942.    *Note Syntax Tables::, for details about syntax classes and how to
  943. make and modify syntax tables.
  944.  
  945. 
  946. File: lispref.info,  Node: Display Table Type,  Next: Extent Type,  Prev: Syntax Table Type,  Up: Editing Types
  947.  
  948. Display Table Type
  949. ------------------
  950.  
  951.    A "display table" specifies how to display each character code.
  952. Each buffer and each window can have its own display table.  A display
  953. table is actually a vector of length 262.  *Note Display Tables::.
  954.  
  955. 
  956. File: lispref.info,  Node: Extent Type,  Prev: Display Table Type,  Up: Editing Types
  957.  
  958. Extent Type
  959. -----------
  960.  
  961.    An "extent" specifies temporary alteration of the display appearance
  962. of a part of a buffer.  It contains markers delimiting a range of the
  963. buffer, plus a property list (a list whose elements are alternating
  964. property names and values).  Extents are used to present parts of the
  965. buffer temporarily in a different display style.  They have no read
  966. syntax, and print in hash notation, giving the buffer name and range of
  967. positions.
  968.  
  969.    *Note Extents::, for how to create and use extents.
  970.  
  971. 
  972. File: lispref.info,  Node: Window-System Types,  Next: Type Predicates,  Prev: Editing Types,  Up: Lisp Data Types
  973.  
  974. Window-System Types
  975. ===================
  976.  
  977.    XEmacs also has some types that represent objects such as fonts and
  978. bitmaps that are commonly found in windowing systems.
  979.  
  980. * Menu:
  981.  
  982. * Font Type::
  983. * Color Type::
  984. * Pixmap Type::
  985.  
  986. 
  987. File: lispref.info,  Node: Font Type,  Next: Color Type,  Up: Window-System Types
  988.  
  989. Font Type
  990. ---------
  991.  
  992. 
  993. File: lispref.info,  Node: Color Type,  Next: Pixmap Type,  Prev: Font Type,  Up: Window-System Types
  994.  
  995. Color Type
  996. ----------
  997.  
  998. 
  999. File: lispref.info,  Node: Pixmap Type,  Prev: Color Type,  Up: Window-System Types
  1000.  
  1001. Pixmap Type
  1002. -----------
  1003.  
  1004. 
  1005. File: lispref.info,  Node: Type Predicates,  Next: Equality Predicates,  Prev: Window-System Types,  Up: Lisp Data Types
  1006.  
  1007. Type Predicates
  1008. ===============
  1009.  
  1010.    The Emacs Lisp interpreter itself does not perform type checking on
  1011. the actual arguments passed to functions when they are called.  It could
  1012. not do so, since function arguments in Lisp do not have declared data
  1013. types, as they do in other programming languages.  It is therefore up to
  1014. the individual function to test whether each actual argument belongs to
  1015. a type that the function can use.
  1016.  
  1017.    All built-in functions do check the types of their actual arguments
  1018. when appropriate, and signal a `wrong-type-argument' error if an
  1019. argument is of the wrong type.  For example, here is what happens if you
  1020. pass an argument to `+' that it cannot handle:
  1021.  
  1022.      (+ 2 'a)
  1023.           error--> Wrong type argument: integer-or-marker-p, a
  1024.  
  1025.    If you want your program to handle different types differently, you
  1026. must do explicit type checking.  The most common way to check the type
  1027. of an object is to call a "type predicate" function.  Emacs has a type
  1028. predicate for each type, as well as some predicates for combinations of
  1029. types.
  1030.  
  1031.    A type predicate function takes one argument; it returns `t' if the
  1032. argument belongs to the appropriate type, and `nil' otherwise.
  1033. Following a general Lisp convention for predicate functions, most type
  1034. predicates' names end with `p'.
  1035.  
  1036.    Here is an example which uses the predicates `listp' to check for a
  1037. list and `symbolp' to check for a symbol.
  1038.  
  1039.      (defun add-on (x)
  1040.        (cond ((symbolp x)
  1041.               ;; If X is a symbol, put it on LIST.
  1042.               (setq list (cons x list)))
  1043.              ((listp x)
  1044.               ;; If X is a list, add its elements to LIST.
  1045.               (setq list (append x list)))
  1046.              (t
  1047.               ;; We only handle symbols and lists.
  1048.               (error "Invalid argument %s in add-on" x))))
  1049.  
  1050.    Here is a table of predefined type predicates, in alphabetical order,
  1051. with references to further information.
  1052.  
  1053. `arrayp'
  1054.      *Note arrayp: Array Functions.
  1055.  
  1056. `atom'
  1057.      *Note atom: List-related Predicates.
  1058.  
  1059. `boolean-specifier-p'
  1060.      *Note boolean-specifier-p: Specifier Types.
  1061.  
  1062. `buffer-live-p'
  1063.      *Note buffer-live-p: Killing Buffers.
  1064.  
  1065. `bufferp'
  1066.      *Note bufferp: Buffer Basics.
  1067.  
  1068. `button-event-p'
  1069.      *Note button-event-p: Event Predicates.
  1070.  
  1071. `button-press-event-p'
  1072.      *Note button-press-event-p: Event Predicates.
  1073.  
  1074. `button-release-event-p'
  1075.      *Note button-release-event-p: Event Predicates.
  1076.  
  1077. `case-table-p'
  1078.      *Note case-table-p: Case Table.
  1079.  
  1080. `char-or-string-p'
  1081.      *Note char-or-string-p: Predicates for Strings.
  1082.  
  1083. `color-instance-p'
  1084.      *Note color-instance-p: Colors.
  1085.  
  1086. `color-specifier-p'
  1087.      *Note color-specifier-p: Colors.
  1088.  
  1089. `commandp'
  1090.      *Note commandp: Interactive Call.
  1091.  
  1092. `compiled-function-p'
  1093.      *Note compiled-function-p: Byte-Code Type.
  1094.  
  1095. `consp'
  1096.      *Note consp: List-related Predicates.
  1097.  
  1098. `cursorp'
  1099.      (not yet documented)
  1100.  
  1101. `device-live-p'
  1102.      *Note device-live-p: Connecting to a Device.
  1103.  
  1104. `device-or-frame-p'
  1105.      *Note device-or-frame-p: Basic Device Functions.
  1106.  
  1107. `devicep'
  1108.      *Note devicep: Devices.
  1109.  
  1110. `eval-event-p'
  1111.      *Note eval-event-p: Event Predicates.
  1112.  
  1113. `event-live-p'
  1114.      *Note event-live-p: Event Predicates.
  1115.  
  1116. `eventp'
  1117.      *Note eventp: Events.
  1118.  
  1119. `extent-live-p'
  1120.      *Note extent-live-p: Creating and Modifying Extents.
  1121.  
  1122. `extentp'
  1123.      *Note extentp: Extents.
  1124.  
  1125. `extent-replica-live-p'
  1126.      *Note extent-replica-live-p: Extent Replicas.
  1127.  
  1128. `extent-replica-p'
  1129.      *Note extent-replica-p: Extent Replicas.
  1130.  
  1131. `facep'
  1132.      *Note facep: Basic Face Functions.
  1133.  
  1134. `floatp'
  1135.      *Note floatp: Predicates on Numbers.
  1136.  
  1137. `font-instance-p'
  1138.      *Note font-instance-p: Fonts.
  1139.  
  1140. `font-specifier-p'
  1141.      *Note font-specifier-p: Fonts.
  1142.  
  1143. `frame-live-p'
  1144.      *Note frame-live-p: Deleting Frames.
  1145.  
  1146. `framep'
  1147.      *Note framep: Frames.
  1148.  
  1149. `generic-specifier-p'
  1150.      *Note generic-specifier-p: Specifier Types.
  1151.  
  1152. `glyphp'
  1153.      *Note glyphp: Glyphs.
  1154.  
  1155. `hashtablep'
  1156.      (not yet documented)
  1157.  
  1158. `image-instance-p'
  1159.      *Note image-instance-p: Images.
  1160.  
  1161. `image-specifier-p'
  1162.      *Note image-specifier-p: Specifier Types.
  1163.  
  1164. `integer-or-marker-p'
  1165.      *Note integer-or-marker-p: Predicates on Markers.
  1166.  
  1167. `integer-specifier-p'
  1168.      *Note integer-specifier-p: Specifier Types.
  1169.  
  1170. `integerp'
  1171.      *Note integerp: Predicates on Numbers.
  1172.  
  1173. `itimerp'
  1174.      (not yet documented).
  1175.  
  1176. `key-press-event-p'
  1177.      *Note key-press-event-p: Event Predicates.
  1178.  
  1179. `keymapp'
  1180.      *Note keymapp: Creating Keymaps.
  1181.  
  1182. `keywordp'
  1183.      (not yet documented)
  1184.  
  1185. `listp'
  1186.      *Note listp: List-related Predicates.
  1187.  
  1188. `markerp'
  1189.      *Note markerp: Predicates on Markers.
  1190.  
  1191. `misc-user-event-p'
  1192.      *Note misc-user-event-p: Event Predicates.
  1193.  
  1194. `motion-event-p'
  1195.      *Note motion-event-p: Event Predicates.
  1196.  
  1197. `natnum-specifier-p'
  1198.      *Note natnum-specifier-p: Specifier Types.
  1199.  
  1200. `natnump'
  1201.      *Note natnump: Predicates on Numbers.
  1202.  
  1203. `nlistp'
  1204.      *Note nlistp: List-related Predicates.
  1205.  
  1206. `numberp'
  1207.      *Note numberp: Predicates on Numbers.
  1208.  
  1209. `number-or-marker-p'
  1210.      *Note number-or-marker-p: Predicates on Markers.
  1211.  
  1212. `process-event-p'
  1213.      *Note process-event-p: Event Predicates.
  1214.  
  1215. `processp'
  1216.      *Note processp: Processes.
  1217.  
  1218. `ringp'
  1219.      (not yet documented)
  1220.  
  1221. `sequencep'
  1222.      *Note sequencep: Sequence Functions.
  1223.  
  1224. `specifierp'
  1225.      *Note specifierp: Specifiers.
  1226.  
  1227. `streamp'
  1228.      (not yet documented)
  1229.  
  1230. `stringp'
  1231.      *Note stringp: Predicates for Strings.
  1232.  
  1233. `subrp'
  1234.      *Note subrp: Function Cells.
  1235.  
  1236. `subwindowp'
  1237.      (not yet documented)
  1238.  
  1239. `symbolp'
  1240.      *Note symbolp: Symbols.
  1241.  
  1242. `syntax-table-p'
  1243.      *Note syntax-table-p: Syntax Tables.
  1244.  
  1245. `timeout-event-p'
  1246.      *Note timeout-event-p: Event Predicates.
  1247.  
  1248. `toolbar-button-p'
  1249.      *Note toolbar-button-p: Toolbar.
  1250.  
  1251. `toolbar-specifier-p'
  1252.      *Note toolbar-specifier-p: Toolbar.
  1253.  
  1254. `user-variable-p'
  1255.      *Note user-variable-p: Defining Variables.
  1256.  
  1257. `vectorp'
  1258.      *Note vectorp: Vectors.
  1259.  
  1260. `wholenump'
  1261.      *Note wholenump: Predicates on Numbers.
  1262.  
  1263. `window-configuration-p'
  1264.      *Note window-configuration-p: Window Configurations.
  1265.  
  1266. `window-live-p'
  1267.      *Note window-live-p: Deleting Windows.
  1268.  
  1269. `windowp'
  1270.      *Note windowp: Basic Windows.
  1271.  
  1272.    The most general way to check the type of an object is to call the
  1273. function `type-of'.  Recall that each object belongs to one and only
  1274. one primitive type; `type-of' tells you which one (*note Lisp Data
  1275. Types::.).  But `type-of' knows nothing about non-primitive types.  In
  1276. most cases, it is more convenient to use type predicates than `type-of'.
  1277.  
  1278.  - Function: type-of OBJECT
  1279.      This function returns a symbol naming the primitive type of
  1280.      OBJECT.  The value is one of `symbol', `integer', `float',
  1281.      `string', `cons', `vector', `marker', `overlay', `window',
  1282.      `buffer', `subr', `compiled-function', `window-configuration', or
  1283.      `process'.
  1284.  
  1285.           (type-of 1)
  1286.                => integer
  1287.           (type-of 'nil)
  1288.                => symbol
  1289.           (type-of '())    ; `()' is `nil'.
  1290.                => symbol
  1291.           (type-of '(x))
  1292.                => cons
  1293.  
  1294.